
#pragma once

#include <pthread.h>
#include "mutex.h"

namespace dulymoo {

class NativeMutex : public IMutex
{
    friend class NativeCondition;
//    friend class NativeEvent;
//    friend class NativeSemaphore;

public:
    NativeMutex();
    virtual ~NativeMutex();

private:
    NativeMutex(const NativeMutex &); // unimplemented
    NativeMutex& operator= (const NativeMutex &); // unimplemented

public:
    virtual bool Lock();
    virtual bool TryLock();
    virtual void Unlock();

private:
    pthread_mutex_t mutex_;
};

} // namespace dulymoo

